﻿
@{
    ViewBag.Title = "用户中心";
    Layout = "~/Views/Shared/_LayoutPage.cshtml";
}
@{
    if (Model != null)
    {
        <style>
            /***个人中心***/
            .summary #photoImage {
                width: 80px;
                height: 80px;
                z-index: 0;
                text-align: center;
            }

            .summary {
                background: url('/Content/image/userBg.png') no-repeat;
                background-size: 100% 100%;
            }

                .summary .head {
                    width: 100%;
                    height: 205px;
                    padding: 26px 0;
                }

                    .summary .head img {
                        border-radius: 50%;
                        border: 0px solid #fff;
                    }

                    .summary .head .username {
                        display: block;
                        color: #fff;
                        margin-top: 7px;
                        font-size: 20px;
                    }

                .summary .headamount {
                    margin-top: 10.5px;
                    margin-left: -1px;
                    padding: 10px 0;
                    height: 50px;
                    background: rgba(0,0,0,0.23);
                }

                    .summary .headamount .p-amount {
                        float: left;
                        margin-top: 1px;
                        color: #4bc4ff;
                        border-left: 1px solid #fff;
                        border-color: rgba(255,255,255,0.3);
                        width: 49.5%;
                    }

                        .summary .headamount .p-amount i {
                            margin-top: -3px;
                            font-size: 20px;
                            color: #fff;
                        }


            .personal {
                padding-bottom: 60px;
            }

                .personal .personal-list {
                    margin-top: 10px;
                    border-top: 1px solid #eee;
                }

                .personal .plist {
                    display: block;
                    height: 44px;
                    background-color: #fff;
                    border-bottom: 1px solid #eee;
                }

                    .personal .plist .safeSet {
                        float: left;
                        margin-top: 9px;
                        margin-left: 10px;
                        margin-right: 10px;
                        background: url(../../Content/image/safeSet.png) 0 0 no-repeat;
                        width: 26px;
                        height: 26px;
                        background-size: 26px 26px;
                    }

                    .personal .plist .systemMessage {
                        float: left;
                        margin-top: 9px;
                        margin-left: 10px;
                        margin-right: 10px;
                        background: url(../../Content/image/mail.png) 0 0 no-repeat;
                        width: 26px;
                        height: 26px;
                        background-size: 26px 26px;
                    }

                    .personal .plist .exitAccount {
                        float: left;
                        margin-top: 9px;
                        margin-left: 10px;
                        margin-right: 10px;
                        background: url(../../Content/image/powerOff.png) 0 0 no-repeat;
                        width: 26px;
                        height: 26px;
                        background-size: 26px 26px;
                    }

                    .personal .plist .serverInfo {
                        float: left;
                        margin-top: 9px;
                        margin-left: 10px;
                        margin-right: 10px;
                        background: url(../../Content/image/serverInfo.png) 0 0 no-repeat;
                        width: 26px;
                        height: 26px;
                        background-size: 26px 26px;
                    }

                    .personal .plist .version {
                        float: left;
                        margin-top: 9px;
                        margin-left: 10px;
                        margin-right: 10px;
                        background: url(../../Content/image/version.png) 0 0 no-repeat;
                        width: 26px;
                        height: 26px;
                        background-size: 26px 26px;
                    }

                    .personal .plist .ptit {
                        float: left;
                        font-size: 15px;
                        margin-top: 10px;
                        color: #4a4a4a;
                    }

                    .personal .plist .auto-icon {
                        float: right;
                        color: #4a4a4a;
                        font-size: 15px;
                        margin-right: 15px;
                        margin-top: 10px;
                    }

                    .personal .plist .iconarrow {
                        float: right;
                        margin-top: 15px;
                        margin-right: 10px;
                        background: url(../../Content/image/icon-right.png) 0 0 no-repeat;
                        width: 8px;
                        height: 14px;
                        background-size: 8px 14px;
                    }

                .personal .personalout {
                    margin: 10px 0;
                    border-top: 1px solid #eee;
                }

            .pink {
                color: #f1483c;
            }

            .p15 {
                padding-left: 15px;
            }
        </style>
        <link href="~/Content/css/jquery-weui.css" rel="stylesheet" />
        <div class="summary">
            <div class="head">
                <img id="photoImage" src="@Model.WxHreadImg">
                <span id="userName" class="username">@Model.UserName</span>
                <div class="headamount">
                    <div id="roleName" class="p-amount">
                        @if (Model.RoleName.Length > 10)
                        {
                            @Model.RoleName.Substring(0, 10)<text>...</text>
                        }
                        else
                        {
                            @Model.RoleName
                        }
                    </div>
                    <div id="companyCode" class="p-amount">
                        @if (Model.CompanyName.Length > 10)
                        {
                            @Model.CompanyName.Substring(0, 10)<text>...</text>
                        }
                        else
                        {
                            @Model.CompanyName
                        }
                    </div>
                </div>
            </div>
        </div>
        <div class="personal">
            <div class="personalout"> <a class="plist"> <span class="systemMessage"></span><span id="L_systemMessage" class="ptit">系统消息</span><span class="iconarrow"></span></a></div>
            @* <div class="personalout"> <a id="changePasswd" class="plist"> <span class="safeSet"></span><span id="L_userChangePasswd" class="ptit">修改密码</span><span class="iconarrow"></span></a></div>*@
            @*<div class="personalout"> <a id="serverInfo" class="plist"> <span class="serverInfo"></span><span id="L_serverInfo" class="ptit"></span><span class="iconarrow"></span></a></div>*@
            @*<div class="personalout"> <a id="version" class="plist"> <span class="version"></span><span id="L_about" class="ptit">版本介绍</span><span class="iconarrow"></span></a></div>*@
            <div class="personalout"> <a id="version" href="@Url.Action("Index","OpsInfo")" class="plist"> <span class="version"></span><span id="L_about" class="ptit">运维百科</span><span class="iconarrow"></span></a></div>
            <div class="personalout"> <a id="exitAccount" class="plist"> <span class="exitAccount"></span><span id="L_exitLogin" class="ptit">解除绑定</span><span class="iconarrow"></span></a></div>
        </div>
        <script src="~/Content/script/jquery-weui.min.js"></script>
        <script type="text/javascript">
            $(function () {
                $("#footer").removeClass('aui-hide');
                //设置头像居中
                //$("#photoImage,#userName").css('margin-left', window.innerWidth / 2 - 40 + 'px');
                $("#photoImage").css('margin-left', window.innerWidth / 2 - 40 + 'px');
                $("#userName").css('text-align', 'center');
                //$("#roleName,#companyCode").css('padding-left', window.innerWidth / 8 + 'px');
                $("#roleName,#companyCode").css('text-align', 'center');
                //解除绑定事件
                $("#exitAccount").click(function() {
                    $.confirm("确定要解除绑定吗?", "确认解绑", function () {
                        //$.post("/api/User/UnBind", "", function (data) {
                        $.post("/api/User/UnWeChatBind", "", function (data) {
                            var result = eval(data);
                            $.toast("操作成功!");
                            setTimeout(function () {
                                location.href = "/Home/Login?rand=" + Math.random() + "";
                            }, 1 * 1000);
                        })
                    }, function () {

                    })
                })
            })


        </script>
    }
}
